package utils;


import constants.CommonConstants;
import constants.DeployMode;

import java.io.IOException;
import java.util.Properties;

public class PropertiesManagerUtil {
    private static Properties properties;
    public static DeployMode mode;

    static{
        properties = new Properties();
        try {
            properties.load(PropertiesManagerUtil.class.getClassLoader().getResourceAsStream(CommonConstants.COMMON_CONFIG_FILE_NAME));
        } catch (IOException e) {
            e.printStackTrace();
        }

        mode = DeployMode.valueOf(getPropertyValue(CommonConstants.CRAWLER_JOB_RUN_MODE).toUpperCase());

    }

    public static String getPropertyValue(String key)
    {
        return properties.getProperty(key);
    }

}
